package com.umeox.watch.moto.chat.ui

import android.content.Intent
import android.os.Bundle
import androidx.recyclerview.widget.GridLayoutManager
import androidx.recyclerview.widget.RecyclerView
import com.umeox.moto.common.decoration.VerticalItemDecoration
import com.umeox.moto.common.log.Logger
import com.umeox.moto.common.ui.BaseActivity
import com.umeox.moto.watch.themes.app.ThemeAppCompatActivity
import com.umeox.watch.moto.chat.R
import com.umeox.watch.moto.chat.adapter.EmojiAdapter
import com.umeox.watch.moto.chat.utils.EmoticonConstants

/**
 * Created by Rambo 2021/8/24
 * Describe:
 */
class EmoticonsActivity : ThemeAppCompatActivity (){

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.fragment_emoticons)
        val rvEmojis: RecyclerView = findViewById(R.id.emojis)
        val emojiAdapter = EmojiAdapter(EmoticonConstants.getEmojiBeans(this))
        emojiAdapter.setOnItemClickListener { id ->
            val data = Intent()
            data.putExtra("emoji_code", id)
            setResult(RESULT_OK, data)
            finish()
        }
        val mGridLayoutManager = GridLayoutManager(this, 3)
        mGridLayoutManager.orientation = RecyclerView.VERTICAL
        rvEmojis.layoutManager = mGridLayoutManager
        rvEmojis.adapter = emojiAdapter

    }

}
